from appium import webdriver

#-----------------------------包名相关信息-----------------
desired_caps = {'platformName': 'Android',
                'deviceName': '127.0.0.1:7555',
                'platformVersion': '8.0',
                'appPackage': 'com.bdgj.yfb',
                'appActivity': 'com.ssf.tckotlin.ui.activity.welcome.WelcomeActivity'
                }
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
driver.implicitly_wait(5)
print('start App')


print('点击客服按钮')
driver.find_element_by_id('iv_customer_service').click()
driver.find_element_by_name('• 取款问题').click()
driver.find_element_by_id('et_msg').send_keys('message')
driver.find_element_by_id('iv_emoji').click()
driver.find_element_by_id('tv_emoji_send').click()
for i in range(50):
    print('发送消息')
    driver.find_element_by_id('et_msg').send_keys('message')
    driver.find_element_by_id('iv_emoji').click()
    driver.find_element_by_id('tv_emoji_send').click()
